import logging,yagmail
def set_log():
    logging.basicConfig(filename="log.txt",filemode='w+',level=logging.DEBUG,
                        format="%(levelname)s -> %(filename)s -> %(asctime)s -> %(message)s")

def send_mail(filepath):
    mail=yagmail.SMTP(user="774877770@qq.com",password="fjvmkwjdijkfbajg",host="smtp.qq.com")
    mail.send(to="1522057104@qq.com",subject="测试",contents=filepath)